home *** CD-ROM | disk | FTP | other *** search
- -- card: 63085 from stack: in
- -- bmap block id: 0
- -- flags: 0000
- -- background id: 4755
- -- name:
-
-
- -- part 1 (field)
- -- low flags: 00
- -- high flags: 0007
- -- rect: left=30 top=78 right=296 bottom=478
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 4
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name:
-
-
- -- part 2 (button)
- -- low flags: 00
- -- high flags: 0001
- -- rect: left=13 top=29 right=57 bottom=351
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: New Button
-
-
- -- part contents for background part 7
- ----- text -----
- 205
-
- -- part contents for background part 4
- ----- text -----
- File 1 of 3. A TC abstract class for graphics and a derived Macintosh-specific version:
-
- -- part contents for card part 1
- ----- text -----
- /*
- * FILE: screen.h
- * AUTHOR: R. Gonzalez
- * CREATED: Aug. 5, 1990
- *
- * Definition of Screen and Mac_Screen classes, to isolate
- * graphics code. These use a console window for stdio I/O and
- * a graphics window using a user-defined view coordinate
- * system. The transform_x() and transform_y() methods
- * translate into screen coordinates for use by machine
- * -dependent drawing routines.
- */
-
- # define _H_screen
-
- typedef int boolean;
- # define TRUE 1
- # define FALSE 0
-
- # define BLACK 0
- # define WHITE 1
- # define RED 1
- # define YELLOW 1
- # define GREEN 1
- # define BLUE 1
- # define CYAN 1
- # define MAGENTA 1
-
- /******************************************************************
- * Screen abstract class to isolate graphics I/O
- ******************************************************************/
- struct Screen:indirect /* or use Generic_Class */
- {
- int screen_width,
- screen_height,
- present_color;
- double view_width,
- view_height,
- view_x,
- view_y;
-
- boolean init(void);
- void graphics_to_front(void);
- void console_to_front(void);
- double get_aspect_ratio(void);
- void set_view(double,double,double,double);
- int transform_x(double);
- int transform_y(double);
- void cursor_on(void);
- void cursor_off(void);
- void color(int);
- void erase_graphics(void);
- void draw_line(double,double,double,double);
- void move_to(double,double);
- void draw_to(double,double);
- void draw_circle(double,double,double);
- void fill_circle(double,double,double);
- boolean mouse_button_is_down(void);
- void get_mouse_location(double*,double*);
- void wait(void);
- };
-
- /******************************************************************
- * Mac_Screen class to allow graphics I/O on Macintosh computers
- ******************************************************************/
- struct Mac_Screen:Screen
- {
- WindowPtr graphics_window,
- console_window;
- CursHandle CrossCursor;
-
- boolean init(void);
- void graphics_to_front(void);
- void console_to_front(void);
- void cursor_on(void);
- void cursor_off(void);
- void color(int);
- void erase_graphics(void);
- void move_to(double,double);
- void draw_to(double,double);
- void draw_circle(double,double,double);
- void fill_circle(double,double,double);
- boolean mouse_button_is_down(void);
- void get_mouse_location(double*,double*);
- };
-
-
-
- -- part contents for background part 6
- ----- text -----
- Portable graphics class and Macintosh version